<style>
    table td p {
        line-height: 20px;
    }
    .td_cs p{
        position: relative;
    }
    .td_cs p i{
        position: absolute;
        left: 0;
        top: 3px;
        color: #00ff00;
    }
    .td_cs p span{
        padding-left: 20px;;
    }

</style>
<div class="contents">
    <ol class="breadcrumb">
        <li><a href="#/index/panel">首页</a></li>
        <li class="active">理财师认证-理财师认证题库</li>
    </ol>
    <form class="form-inline search-box" role="form" ng-submit="search()" novalidate>
        <!--<div class="form-group">-->
        <!--<input type="text" class="form-control" placeholder="faID" ng-model="searchMap.id" style="width:100px;">-->
        <!--</div> -->
        <!--<div class="form-group">-->
        <!--<input type="text" class="form-control" placeholder="机构faID" ng-model="searchMap.uManagerId" style="width:140px;">-->
        <!--</div> -->
        <!--<div class="form-group">-->
            <!--创建时间：从<input type="date" class="form-control" placeholder="注册开始日期,如2015-01-01" ng-model="searchMap.createDateStart" maxlength="10">-->
        <!--</div>-->

        <!--<div class="form-group">-->
            <!--至<input type="date" class="form-control" placeholder="注册结束日期,如2015-01-01" ng-model="searchMap.createDateEnd" maxlength="10">-->
        <!--</div>-->

        <!--<button type="submit" class="btn btn-primary">查询</button>-->
        <div class="form-group" style="height: 35px"></div>
            <button type="button" style="float: right !important;" class="btn btn-primary" ng-click="addnewanswer()">新增题目</button>

    </form>
    <table class="table table-striped table-hover">
        <tbody>
        <tr>
            <td>题目列表</td>
        </tr>
        <tr ng-repeat="d in list">
            <td class="td_cs">
                <p>{{$index+1}}.题目：{{d.content}}<span style="float: right"><a ng-click="editsubans(d)">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;<a ng-click="deletesubans(d)">删除</a></span></p>
                <p ng-repeat="p in d.answer track by $index"><i ng-if="d.trueAnswer === p.subno" class="glyphicon glyphicon-check" ></i><span >{{p.subno}}.{{p.subcon}}</span></p>
            </td>
        </tr>
        </tbody>
    </table>

    <div style="display: inline-block" class="pager-box" ng-include src="'tpl/public/pager.html'" ng-show="list.length > 0"></div>
    <div style="display: inline-block;vertical-align: text-bottom;margin: 15px;color: #428bca;font-size: 14px" class="form-inline" ng-show="list.length > 0">
        <label style="vertical-align: sub;font-weight: 400">每页显示：</label><input type="number" class="form-control" ng-model="setPageSize" max="1000"><label style="vertical-align: baseline;font-weight: 400" >&nbsp;&nbsp;条（最大1000条）<button type="button" class="btn btn-primary" ng-click="changePageSize()" style="vertical-align: sub">确定</button></label>
    </div>
</div>

<div class="layer-box" ng-if="showaddanswer">
    <div class="layer-bg"></div>
    <div class="layer-con " style="padding:10px 10px;">
        <span style="cursor: pointer; height: 20px;width: 20px;display: inline-block;z-index: 99999" ng-click="hideaddans()" class="icons-close" title="关闭">X</span>
        <div class="layer-title">
            <h3 style="font-size: 16px">新增题目</h3>
        </div>
        <div class="con-wrap">
            <div class="form-group" >
                <table class="order-f-h" style="width:100%">
                    <tr>
                        <td>
                            <p style="text-align: left">题目</p>
                            <p><textarea cols="40" ng-model="subjectitem.content" rows="5"></textarea></p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p style="text-align: left">答案<a style="padding-left: 10px;cursor: pointer" ng-click="addAnswer()"><i style="color: #6495ed" class="glyphicon glyphicon-plus"></i></a></p>
                            <!--<p style="padding-left:10px;text-align: left; padding-top: 10px">A：<input type="text" style="width: 200px"/><a style="color: #6495ed;cursor: pointer;padding-left: 10px;">设为正确答案</a></p>-->
                            <p ng-repeat="d in answerarr track by $index" style="padding-left:10px;text-align: left; padding-top: 10px">
                                {{d.subno}}：<input type="text" ng-model="d.subcon" style="width: 150px"/>
                                <button ng-click="delAnswer($index)">删除</button>
                                <span ng-if="subjectitem.trueAnswer === d.subno" style="color: #00ff00;padding-left: 10px;">正确答案</span>
                                <a ng-if="subjectitem.trueAnswer != d.subno" style="color: #6495ed;cursor: pointer;padding-left: 10px;" ng-click="setTrueAnswer(d.subno)">设为正确答案</a>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            </span><button class="btn btn-block btn-primary" style="width: 100px;margin-top: 10px" ng-click="saveSub();">保存</button>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>
